package com.sugar.real.estate.module.business.dal.mysql.dicttype;

import com.sugar.real.estate.framework.common.pojo.PageResult;
import com.sugar.real.estate.framework.mybatis.core.mapper.BaseMapperX;
import com.sugar.real.estate.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.sugar.real.estate.module.business.controller.admin.dicttype.vo.BizDictTypePageReqVO;
import com.sugar.real.estate.module.business.dal.dataobject.dicttype.BizDictTypeDO;
import org.apache.ibatis.annotations.Mapper;

/**
 * 字典类型 Mapper
 *
 * @author Ysugar
 */
@Mapper
public interface BizDictTypeMapper extends BaseMapperX<BizDictTypeDO> {

    default PageResult<BizDictTypeDO> selectPage(BizDictTypePageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<BizDictTypeDO>()
                .eqIfPresent(BizDictTypeDO::getLabel, reqVO.getLabel())
                .betweenIfPresent(BizDictTypeDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(BizDictTypeDO::getId));
    }

}